#ifndef __TIMELINE_H__
#define __TIMELINE_H__

#include <sys/time.h>
#include "dtk_types.h"
#include "dtk_object.h"
#include "dtk_list.h"

typedef void (*DTKKeytimeCallback) (DUInt msecs, DPointer usrdata);

typedef struct keytimefuncs
{
    DLink               link;
    DUInt               id;
    DTKKeytimeCallback  func;
    DPointer            usrdata;
}KeytimeFuncs;

typedef struct _dtk_keytime
{
    DLink                   link;
    struct _dtk_keytime*    next;
    DUInt                   key_time;
    DList                   list;    
}DTKKeytime;

struct _dtk_timeline
{
    DTKObject       base;
    DLink           link;
    DBoolean        is_playing;
    DBoolean        loop;
    DUInt           duration;
    DUInt           delay;

    DBoolean        waiting_first_tick;
    struct timeval  start_frame_time;
    DUInt64         past_time;

    DList           list;

};

#endif
